﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using JM.JCY.BusinessEntity;
using JM.JCY.Proxy;
using NCS.IConnect.ApplicationContexts;
using JM.JCY.Common;
using JM.JCY.Common.Utilities;
using Microsoft.SharePoint;

namespace JM.JCY.SharePointComponent.IncorruptArchives.CreateLingDaoDangFengCheck
{
    public partial class CreateLingDaoDangFengCheckUserControl : UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

            }
        }

        protected void imgSubmit_Click(object sender, ImageClickEventArgs e)
        {
            using (IncorruptProxy proxy = new IncorruptProxy())
            {
                var newDT = new IncorruptDataSet.T_LingDaoDangFengCheckDataTable();
                var newRow = newDT.NewT_LingDaoDangFengCheckRow();

                //个人信息
                newRow.Name = this.txtName.Text;
                newRow.Gender = this.rbGender.SelectedValue;
                newRow.DOB = this.dtDOB.SelectedDate;
                newRow.Nationality = this.txtNationality.Text;
                newRow.CultureDegree = this.txtCultureDegree.Text;
                newRow.CurrentJobDay = this.txtCurrentJobDay.Text;
                newRow.CompanyPosition = this.txtCompanyPosition.Text;
                //配偶信息
                newRow.SpouseName = this.txtSpouseName.Text;
                newRow.SpouseGender = this.rbSpouseGender.SelectedValue;
                newRow.SpouseDOB = this.dtSpouseDOB.SelectedDate;
                newRow.SpouseNationality = this.txtSpouseNationality.Text;
                newRow.SpouseCultureDegree = this.txtSpouseCultureDegree.Text;
                newRow.SpouseCurrentJobDay = this.txtSpouseCurrentJobDay.Text;
                newRow.SpouseCompanyPosition = this.txtSpouseCompanyPosition.Text;

                //（二）执行党风廉政建设责任制（对照检查高检院《实施办法》中职责内容填写）
                newRow.Section2 = this.txtSection2.Text;

                //(三)廉洁自律及重大事项情况

                newRow.HouseAddress = this.txtHouseAddress.Text;
                newRow.HouseSize = this.txtHouseSize.Text;
                newRow.HouseType = this.txtHouseType.Text;
                newRow.OtherHouseAddress = this.txtOtherHouseAddress.Text;
                newRow.OtherHouseSize = this.txtOtherHouseSize.Text;
                newRow.OtherHouseType = this.txtOtherHouseType.Text;

                newRow.BusinessTravelTime = this.txtBusinessTravelTime.Text;
                newRow.BusinessTravelReason = this.txtBusinessTravelReason.Text;
                newRow.BusinessTravelArea = this.txtBusinessTravelArea.Text;
                newRow.BusinessTravelSpenseSource = this.txtBusinessTravelSpenseSource.Text;

                newRow.PersonalTravelTime1 = this.txtPersonalTravelTime1.Text;
                newRow.PersonalTravelReason1 = this.txtPersonalTravelReason1.Text;
                newRow.PersonalTravelArea1 = this.txtPersonalTravelArea1.Text;
                newRow.PersonalTravelSpenseSource1 = this.txtPersonalTravelSpenseSource1.Text;

                newRow.PersonalTravelTime2 = this.txtPersonalTravelTime2.Text;
                newRow.PersonalTravelReason2 = this.txtPersonalTravelReason2.Text;
                newRow.PersonalTravelArea2 = this.txtPersonalTravelArea2.Text;
                newRow.PersonalTravelSpenseSource2 = this.txtPersonalTravelSpenseSource2.Text;

                newRow.CarGeneral = this.txtCarGeneral.Text;
                newRow.CarBrand = this.txtCarBrand.Text;
                newRow.CarDisplacement = this.txtCarDisplacement.Text;
                newRow.CarPrice = this.txtCarPrice.Text;

                newRow.PhoneClaimYear = this.txtPhoneClaimYear.Text;
                newRow.MobilePhoneClaimStandard = this.txtMobilePhoneClaimStandard.Text;
                newRow.MobilePhoneActualClaim = this.txtMobilePhoneActualClaim.Text;
                newRow.HomePhoneClaimStandard = this.txtHomePhoneClaimStandard.Text;
                newRow.HomePhoneActualClaim = this.txtHomePhoneActualClaim.Text;

                newRow.RelatedName1 = this.txtRelatedName1.Text;
                newRow.RelationShip1 = this.txtRelationShip1.Text;
                newRow.RelatedJobType1 = this.txtRelatedJobType1.Text;
                newRow.RelatedCompany1 = this.txtRelatedCompany1.Text;
                newRow.RelatedPosition1 = this.txtRelatedPosition1.Text;

                newRow.RelatedName2 = this.txtRelatedName2.Text;
                newRow.RelationShip2 = this.txtRelationShip2.Text;
                newRow.RelatedJobType2 = this.txtRelatedJobType2.Text;
                newRow.RelatedCompany2 = this.txtRelatedCompany2.Text;
                newRow.RelatedPosition2 = this.txtRelatedPosition2.Text;

                newRow.RelatedName3 = this.txtRelatedName3.Text;
                newRow.RelationShip3 = this.txtRelationShip3.Text;
                newRow.RelatedJobType3 = this.txtRelatedJobType3.Text;
                newRow.RelatedCompany3 = this.txtRelatedCompany3.Text;
                newRow.RelatedPosition3 = this.txtRelatedPosition3.Text;

                newRow.RelatedName4 = this.txtRelatedName4.Text;
                newRow.RelationShip4 = this.txtRelationShip4.Text;
                newRow.RelatedJobType4 = this.txtRelatedJobType4.Text;
                newRow.RelatedCompany4 = this.txtRelatedCompany4.Text;
                newRow.RelatedPosition4 = this.txtRelatedPosition4.Text;

                newRow.PeculationYear1 = this.txtPeculationYear1.Text;
                newRow.PeculationTotalTimes1 = this.txtPeculationTotalTimes1.Text;
                newRow.PeculationTotalAmount1 = this.txtPeculationTotalAmount1.Text;
                newRow.CandorTotalAmount1 = this.txtCandorTotalAmount1.Text;
                newRow.PeculationTotalCount1 = this.txtPeculationTotalCount1.Text;
                newRow.CandorTotalCount1 = this.txtCandorTotalCount1.Text;

                newRow.PeculationYear2 = this.txtPeculationYear2.Text;
                newRow.PeculationTotalTimes2 = this.txtPeculationTotalTimes2.Text;
                newRow.PeculationTotalAmount2= this.txtPeculationTotalAmount2.Text;
                newRow.CandorTotalAmount2 = this.txtCandorTotalAmount2.Text;
                newRow.PeculationTotalCount2 = this.txtPeculationTotalCount2.Text;
                newRow.CandorTotalCount2 = this.txtCandorTotalCount2.Text;

                newRow.PeculationYear3 = this.txtPeculationYear3.Text;
                newRow.PeculationTotalTimes3 = this.txtPeculationTotalTimes3.Text;
                newRow.PeculationTotalAmount3= this.txtPeculationTotalAmount3.Text;
                newRow.CandorTotalAmount3 = this.txtCandorTotalAmount3.Text;
                newRow.PeculationTotalCount3 = this.txtPeculationTotalCount3.Text;
                newRow.CandorTotalCount3 = this.txtCandorTotalCount3.Text;

                newRow.PeculationYear4 = this.txtPeculationYear4.Text;
                newRow.PeculationTotalTimes4 = this.txtPeculationTotalTimes4.Text;
                newRow.PeculationTotalAmount4 = this.txtPeculationTotalAmount4.Text;
                newRow.CandorTotalAmount4 = this.txtCandorTotalAmount4.Text;
                newRow.PeculationTotalCount4 = this.txtPeculationTotalCount4.Text;
                newRow.CandorTotalCount4 = this.txtCandorTotalCount4.Text;

                newRow.PeculationYear5 = this.txtPeculationYear5.Text;
                newRow.PeculationTotalTimes5 = this.txtPeculationTotalTimes5.Text;
                newRow.PeculationTotalAmount5 = this.txtPeculationTotalAmount5.Text;
                newRow.CandorTotalAmount5 = this.txtCandorTotalAmount5.Text;
                newRow.PeculationTotalCount5 = this.txtPeculationTotalCount5.Text;
                newRow.CandorTotalCount5 = this.txtCandorTotalCount5.Text;

                //(三)廉洁自律及重大事项情况（本人认为其他需要向组织报告的重大事项）
                newRow.Section3Others = this.txtSection3Others.Text;

                //（四）领导班子主要领导审核意见
                newRow.Section4 = this.txtSection4.Text;

                //（五）检查考评组审核意见
                newRow.Section5 = this.txtSection5.Text;

                newRow.FillDate = this.dtFillDate.SelectedDate;
                JCYUtility.UpdateCommonFields(newRow, "Iori");
                newDT.AddT_LingDaoDangFengCheckRow(newRow);
                proxy.UpdateLingDaoDangFengCheck(newDT);

                Response.Redirect("LingDaoDangFengCheck.aspx");

            }

        }

        protected void imgCancel_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("LingDaoDangFengCheck.aspx");
        }
    }
}
